package com.sky.utils;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class CommonUtil {
    //生成订单号
    public static String generateOrderNum(){
        //格式：2024-12-20-11-4250

        LocalDateTime now = LocalDateTime.now();
        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
        String orderNumberString = now.format(dateTimeFormatter);
        //
        Integer randomNumber = ValidateCodeUtils.generateValidateCode(4);
        return orderNumberString+randomNumber;
    }
}
